package praktikumid.w09.p2;

import java.awt.BorderLayout;

import javax.swing.JFrame;

/**
 * Frame.
 * @author Ago
 *
 */
public class MyFrame extends JFrame {

	/**
	 * Private reference to the draw panel.
	 */
	private DrawPanel dp;
	
	/**
	 * Constructor. Initializes the frame.
	 */
	public MyFrame() { // constructor
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setSize(600, 600);
		
		ButtonPanel bp = new ButtonPanel(this);
		dp = new DrawPanel();
		// let's add button panel to the left
		getContentPane().add(bp, BorderLayout.WEST);
		// and draw panel to the center 
		// (fills the rest of the content pane)
		getContentPane().add(dp, BorderLayout.CENTER);
	}
	
	/**
	 * Getter for the DrawPanel.
	 * @return Reference to the DrawPanel.
	 */
	public DrawPanel getDrawPanel() {
		return dp;
	}
}
